<?php 
include 'mysql.php';
$sql_follow = 'select * from studentmessage order by ID desc';//查询语句
$result = mysqli_query($link,$sql_follow);

// echo '<div id="wrapper_follow">';
// echo '<div id="center_follow">';



// echo '</div>';
// echo '</div>';




?>
<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title></title>
	<style>
		#wrapper_follow 
		{
			width: 100%;
			height: 100%;
			/* background-color: #008080; */
			overflow: auto;
			display: flex;
			position: absolute;
			right: 0;
			top: 0%;
			border-radius: 12px;
			flex-wrap: wrap;/*记得换行*/
		}
		.center_follow
		{
			width: 100%;
			
			/* background-color: #00CED1; */
		}
		.from_follow
		{
			font-family:"agency fb";
			text-align: right;
		}
		#text_max
		{
			font-size: 1.375rem;
		}
	</style>
</head>
<body>
	<div id="wrapper_follow">
		<!-- 最大的块 -->
		<?php 
		while($rows = mysqli_fetch_assoc($result))
		{
			echo '<div class="center_follow">'; //遍历内容的开头
			echo '<div class="text_follow">'.$rows['message'].'</div>';
			echo  $rows['studentID'] =="" ? '<div class="from_follow"><p id="text_max">from:匿名</p><p>'.@$rows['TIME'].'</p></div>':'<div class="from_follow"><p id="text_max">from:'.@$rows['studentID'].'</p><p>'.@$rows['TIME'].'</p></div>';
			
			echo '</div>';//遍历内容的结尾
		}
		
		
		
		
		?>
		
			<!-- 要遍历的内容 -->
			
				<!-- 这是文本内容 -->
				<!-- 输出文字<br>
				这是测试文本 -->
				
			
			
				
		
		<!-- ----------下面的内容要删除仅测试使用--------------- -->
		<!-- ------------------------------------------- -->
	</div>
	
	
</body>
</html>